/**
 * 
 */
package de.homeR.services.domain;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import de.homer.adapter.domain.PluginMetaInformation;

/**
 * This class wraps a {@link Collection} of {@link PluginMetaInformation} for
 * returning it with REST.
 * 
 * @author André Stannek
 * 
 */
@XmlRootElement
public class PluginMetaInformationCollection {

	/**
	 * Wrapped list.
	 */
	@XmlElement(name = "plugin")
	private List<PluginMetaInformation> plugins;

	/**
	 * @param plugins
	 *            the plugin {@link Collection} to wrap
	 */
	public PluginMetaInformationCollection(
			final Collection<PluginMetaInformation> plugins) {
		super();
		this.plugins = new ArrayList<>(plugins);
	}

	/**
	 * Default constructor needed by REST framework.
	 */
	public PluginMetaInformationCollection() {
		super();
		plugins = new ArrayList<>();
	}

	/**
	 * @return the wrapped list
	 */
	public final List<PluginMetaInformation> getPlugins() {
		return plugins;
	}
}
